package com.shuai.chatroom.service;


import com.shuai.chatroom.entity.UserInfo;
import com.shuai.chatroom.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserService {
    @Resource
    private UserMapper userMapper;

    public int register(UserInfo userInfo) {
        return userMapper.register(userInfo);
    }

    public UserInfo login(String username) {
        return userMapper.login(username);
    }

    public int uploadPhoto(Integer uId, String photo) {
        return userMapper.uploadPhoto(uId, photo);
    }

    public List<UserInfo> getUsersLikeName(String username) {
        return userMapper.getUsersLikeName(username);
    }
}
